package io.simple.core.chain;

import io.simple.core.RequestContext;
import io.simple.signals.Signal;

import java.nio.ByteBuffer;

/**
 * Created by rehak on 2/11/14.
 */
public interface Pipeline {

    /**
     * @param path request path
     * @return true if can process request with this path or false otherwise
     */
    public boolean canProcess(String path);

    /**
     * Process request
     *
     * @param ctx
     * @return
     * @throws Signal
     */
    public ByteBuffer process(RequestContext ctx, ByteBuffer data) throws Signal;

}
